package com.winway.sixbook.ui;

import com.winway.sixbook.R;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity {
	
	private static final String TAG = "MainActivity";
	private Button main_btn_setButton = null;
	private Button main_btn_addButton = null;
	private Button main_btn_todayButton = null;
	private Button main_btn_counterButton = null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.mainactivity);
		//初始化
		mainInit();
	}
	
	
	private void mainInit(){
		main_btn_setButton = (Button)findViewById(R.id.main_btn_set);
		main_btn_addButton = (Button)findViewById(R.id.main_btn_add);
		main_btn_todayButton = (Button)findViewById(R.id.main_btn_today);
		main_btn_counterButton = (Button)findViewById(R.id.main_btn_counter);
		
		main_btn_setButton.setOnClickListener(mListener);
		main_btn_addButton.setOnClickListener(mListener);
		main_btn_todayButton.setOnClickListener(mListener);
		main_btn_counterButton.setOnClickListener(mListener);
	}
	
	OnClickListener mListener = new OnClickListener() {
		@Override
		public void onClick(View v) {
			switch (v.getId()) {
				case R.id.main_btn_set:
					Log.v(TAG, "设置");
					Intent intentset = new Intent(MainActivity.this, SetActivity.class);
					startActivity(intentset);
					break;
				case R.id.main_btn_add:
					Log.v(TAG, "新增");
					break;
				case R.id.main_btn_today:
					Log.v(TAG, "今天");
					Intent intent = new Intent(MainActivity.this, TodayListActivity.class);
					startActivity(intent);
					break;
				case R.id.main_btn_counter:
					Intent counter = new Intent(MainActivity.this, CounterListActivity.class);
					
					startActivity(counter);
					Log.v(TAG, "计数器");
					break;
			}
		}
	};
}
